import { PrismaClient } from '@prisma/client'
import { readBody } from 'h3'
const prisma = new PrismaClient()

export default defineEventHandler(async (event) => {
    const params = await readBody(event)
    const { page=1, limit=10 } = await readBody(event)
    const skip = (parseInt(page)-1)*parseInt(limit)
    // 查询考试信息
    const topic = await prisma.topic.findMany({
        where: {
            publish: true,
            deletedAt: null,
        },
        skip: skip,
        take: parseInt(limit),
    })
    return topic
})

